#include <iostream>
#include <config_dao.h>
#include <xplatform/protobuf/xmsg_com.pb.h>
#include <xplatform/XCom.h>
#include "xconfig_server.h"
#include "xconfig_handle.h"
#include <register/register_client/xregister_client.h>
using namespace std;

int main(int argc, char *argv[]){
    cout<<"config server"<<endl;
    if(!ConfigDao::Get()->Init("127.0.0.1","root","ZhangHu@13356","xcom")){
        cout<<"init config failed"<<endl;
        return 1;
    }
    cout<<"init config success"<<endl;
    if(!ConfigDao::Get()->Install()){
        cout<<"install config failed"<<endl;
        return 1;
    }
    cout<<"install config success"<<endl;
    XConfigServerHandle::RegMsgCallback();
    XConfigServer server;
    server.Main(argc,argv);
    server.Start();
    server.Wait();
}